home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / HotboxControlsMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  8.8 KB  |  278 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  31 May 1997
  22. // Author:         gf
  23. //
  24. //
  25. //  Procedure Name:
  26. //      HotboxControlsMenu
  27. //
  28. //  Description:
  29. //        Create the user customizable Hotbox Controls Menu for hotbox
  30. //
  31. //  Input Arguments:
  32. //      parent to parent the menu to.
  33. //
  34. //  Return Value:
  35. //      None.
  36. //
  37.  
  38. global proc updateHotboxOptionVarSettings() {
  39.  
  40.     optionVar
  41.         -intValue isHotBoxModelingRowVisible     `hotBox -q -mt`
  42.         -intValue isHotBoxAnimationRowVisible    `hotBox -q -at`
  43.         -intValue isHotBoxDynamicsRowVisible     `hotBox -q -dt`
  44.         -intValue isHotBoxRenderingRowVisible    `hotBox -q -rt`
  45.         -intValue isHotBoxCommonRowVisible       `hotBox -q -ct`
  46.         -intValue isHotBoxPaneSpecificRowVisible `hotBox -q -pt`
  47.         -intValue isHotBoxClothRowVisible         `hotBox -q -clt`
  48.         -intValue isHotBoxLiveRowVisible         `hotBox -q -lt`
  49.         -intValue isHotBoxRmbPopupsOn            `hotBox -q -rmb`
  50.         -intValue isHotBoxShowAll         `hotBox -q -a`
  51.  
  52.         -intValue hotBoxTransparencyLevel `hotBox -q -tr`;
  53.  
  54.     if( `menuItem -exists hotboxModelingRowVisibilityCheckboxMenuItem` )
  55.         menuItem -e -cb `hotBox -q -mt` hotboxModelingRowVisibilityCheckboxMenuItem;
  56.  
  57.     if( `menuItem -exists hotboxAnimationRowVisibilityCheckboxMenuItem` )
  58.         menuItem -e -cb `hotBox -q -at` hotboxAnimationRowVisibilityCheckboxMenuItem;
  59.  
  60.     if( `menuItem -exists hotboxDynamicsRowVisibilityCheckboxMenuItem` )
  61.         menuItem -e -cb `hotBox -q -dt` hotboxDynamicsRowVisibilityCheckboxMenuItem;
  62.  
  63.     if( `menuItem -exists hotboxRenderingRowVisibilityCheckboxMenuItem` )
  64.         menuItem -e -cb `hotBox -q -rt` hotboxRenderingRowVisibilityCheckboxMenuItem;
  65.  
  66.     if( `menuItem -exists hotboxCommonRowVisibilityCheckboxMenuItem` )
  67.         menuItem -e -cb `hotBox -q -ct` hotboxCommonRowVisibilityCheckboxMenuItem;
  68.  
  69.     if( `menuItem -exists hotboxPaneSpecificRowVisibilityCheckboxMenuItem` )
  70.         menuItem -e -cb `hotBox -q -pt` hotboxPaneSpecificRowVisibilityCheckboxMenuItem;
  71.  
  72.     if( `menuItem -exists hotboxClothRowVisibilityCheckboxMenuItem` )
  73.         menuItem -e -cb `hotBox -q -clt` hotboxClothRowVisibilityCheckboxMenuItem;
  74.  
  75.     if( `menuItem -exists hotboxLiveRowVisibilityCheckboxMenuItem` )
  76.         menuItem -e -cb `hotBox -q -lt` hotboxLiveRowVisibilityCheckboxMenuItem;
  77.  
  78. }
  79.  
  80.  
  81. global proc toggleMainMenubar( int $state ){
  82.  
  83.     global string $gMainWindow;
  84.  
  85.     optionVar -iv mainWindowMenubarVis $state;
  86.  
  87.     window -e -mbv $state $gMainWindow;
  88. }
  89.  
  90.  
  91. global proc buildWinOptions( string $parent)
  92. {
  93.     setParent -m $parent;
  94.  
  95.     // Make sure this submenu is rebuilt
  96.     // everytime to ensure checkboxes are updated
  97.     //
  98.     if( `menu -q -ni $parent` != 0 ) {
  99.         //
  100.         //    Menu is built already - just clear it.
  101.         //
  102.         menu -e -deleteAllItems $parent; 
  103.     }
  104.  
  105.     //    Fix for Bug #156604
  106.     //    On the Mac - We do-not provide option to show/hide Main Menubar
  107.     //    as this is a *really *nasty thing to do*. It is really only 
  108.     //    intended for games and such which want to go into fullscreen mode
  109.     //
  110.     if (!`about -mac`) {
  111.         menuItem -l "Show Main Menubar" 
  112.             -ecr false
  113.             -cb `optionVar -q mainWindowMenubarVis`
  114.             -c "toggleMainMenubar #1";
  115.  
  116.     }
  117.     menuItem -l "Show Pane Menubars"
  118.         -ecr false
  119.         -cb `optionVar -q allowMenusInPanels`
  120.         -c "toggleMenuBarsInAllPanels #1";
  121.  
  122. }
  123.  
  124. global proc buildHotboxStyleMenu(string $parent)
  125. {
  126.     setParent -m $parent;
  127.  
  128.     // Make sure this submenu is rebuilt
  129.     // everytime to ensure checkboxes are updated
  130.     //
  131.     if( `menu -q -ni $parent` != 0 ) {
  132.         //
  133.         //    Menu is built already - just clear it.
  134.         //
  135.         menu -e -deleteAllItems $parent; 
  136.     }
  137.  
  138.     menuItem -l "Zones and Menu Rows"
  139.         -c "hotBox -dh";
  140.     menuItem -l "Zones Only"
  141.         -c "hotBox -dzo";
  142.     menuItem -l "Center Zone Only"
  143.         -c "hotBox -dco";
  144.     menuItem -divider true;
  145.     menuItem -l "Center Zone RMB Popups"
  146.         -cb `hotBox -q -rmb`
  147.         -c "hotBox -rmb #1;  updateHotboxOptionVarSettings()"
  148.         hotboxRmbPopupsCheckboxMenuItem;
  149.  
  150. }
  151.  
  152.  
  153.  
  154. // It's preferable for this code to not be contained within
  155. // a procedure, because this code will only be run once,
  156. // and procedure definitions eat up memory.
  157. //
  158. //global proc HotboxControlsMenu( string $parent )
  159. //{
  160. //    setParent -m $parent;
  161. //    if( `menu -q -ni $parent` != 0 ) {
  162. //        //
  163. //        //    Menu is built already - just return
  164. //        //
  165. //        return;
  166. //    }
  167.  
  168.     menuItem -rp "N" -l "Show Modeling" -subMenu true;
  169.             menuItem -rp "N" -l "Modeling Only"
  170.                 -c ("hotBox -mo; setMenuMode \"Modeling\"; updateHotboxOptionVarSettings()");
  171.             menuItem -rp "S" -l "Show/Hide Modeling"
  172.                 -cb `hotBox -q -mt`
  173.                 -c "hotBox -mt #1; updateHotboxOptionVarSettings()"
  174.                 hotboxModelingRowVisibilityCheckboxMenuItem;
  175.     setParent -m ..;
  176.  
  177.     menuItem -rp "E" -l "Show Animation" -subMenu true;
  178.             menuItem -rp "E" -l "Animation Only"
  179.                 -c ("hotBox -ao; setMenuMode \"Animation\"; updateHotboxOptionVarSettings()");
  180.             menuItem -rp "W" -l "Show/Hide Animation"
  181.                 -cb `hotBox -q -at`
  182.                 -c "hotBox -at #1; updateHotboxOptionVarSettings()"
  183.                 hotboxAnimationRowVisibilityCheckboxMenuItem;
  184.     setParent -m ..;
  185.  
  186.     menuItem -rp "S" -l "Show Dynamics" -subMenu true;
  187.             menuItem -rp "S" -l "Dynamics Only"
  188.                 -c ("hotBox -do; setMenuMode \"Dynamics\"; updateHotboxOptionVarSettings()");
  189.             menuItem -rp "N" -l "Show/Hide Dynamics"
  190.                 -cb `hotBox -q -dt`
  191.                 -c "hotBox -dt #1; updateHotboxOptionVarSettings()"
  192.                 hotboxDynamicsRowVisibilityCheckboxMenuItem;
  193.     setParent -m ..;
  194.  
  195.     menuItem -rp "SW" -l "Show All"
  196.                 -c "hotBox -a true; updateHotboxOptionVarSettings()";
  197.     setParent -m ..;
  198.  
  199.     menuItem -rp "SE" -l "Hide All"
  200.                 -c "hotBox -a false; updateHotboxOptionVarSettings()";
  201.     setParent -m ..;
  202.  
  203.     menuItem -rp "W" -l "Show Rendering" -subMenu true;
  204.             menuItem -rp "W" -l "Rendering Only"
  205.                 -c ("hotBox -ro; setMenuMode \"Rendering\"; updateHotboxOptionVarSettings()");
  206.             menuItem -rp "E" -l "Show/Hide Rendering"
  207.                 -cb `hotBox -q -rt`
  208.                 -c "hotBox -rt #1; updateHotboxOptionVarSettings()"
  209.                 hotboxRenderingRowVisibilityCheckboxMenuItem;
  210.     setParent -m ..;
  211.  
  212.  
  213.     //     Overflow
  214.     //
  215.     menuItem -l "Show Common Menus"
  216.                 -cb `hotBox -q -ct`
  217.                 -c "hotBox -ct #1; updateHotboxOptionVarSettings()"
  218.                 hotboxCommonRowVisibilityCheckboxMenuItem;
  219.     menuItem -l "Show Pane Specific Menus"
  220.                 -cb `hotBox -q -pt`
  221.                 -c "hotBox -pt #1; updateHotboxOptionVarSettings()"
  222.                 hotboxPaneSpecificRowVisibilityCheckboxMenuItem;
  223.  
  224.      // Show the Cloth and Live Menus only if licenseType of Maya is 'Unlimited'
  225.      //
  226.      string $licenseType = `about -p`;
  227.      $licenseType = match("Unlimited", $licenseType);
  228.      if ( $licenseType == "Unlimited" ) 
  229.      {
  230.         menuItem -l "Show Cloth Menus"
  231.                     -cb `hotBox -q -clt`
  232.                     -c "hotBox -clt #1; updateHotboxOptionVarSettings()"
  233.                     hotboxClothRowVisibilityCheckboxMenuItem;
  234.  
  235.  
  236.         menuItem -l "Show Live Menus"
  237.                     -cb `hotBox -q -lt`
  238.                     -c "hotBox -lt #1; updateHotboxOptionVarSettings()"
  239.                     hotboxLiveRowVisibilityCheckboxMenuItem;
  240.  
  241.      }
  242.     // Transparency control items
  243.     int $percentage = `optionVar -query hotBoxTransparencyLevel`;
  244.     menuItem -l "Set Transparency" -subMenu true;
  245.     if (`about -mac`) {
  246.         menuItem -l "Unsupported = 100%" -en 0;
  247.     } else {
  248.         radioMenuItemCollection;
  249.         menuItem -l "0%"
  250.             -rb ($percentage == 0)
  251.             -c "hotBox -tr 0; updateHotboxOptionVarSettings()";
  252.         menuItem -l "25%"
  253.             -rb ($percentage == 25)
  254.             -c "hotBox -tr 25; updateHotboxOptionVarSettings()";
  255.         menuItem -l "50%"
  256.             -rb ($percentage == 50)
  257.             -c "hotBox -tr 50; updateHotboxOptionVarSettings()";
  258.         menuItem -l "75%"
  259.             -rb ($percentage == 75)
  260.             -c "hotBox -tr 75; updateHotboxOptionVarSettings()";
  261.         menuItem -l "100%"
  262.             -rb ($percentage == 100)
  263.             -c "hotBox -tr 100; updateHotboxOptionVarSettings()";
  264.     }
  265.     setParent -m ..;
  266.  
  267.     string $menu = `menuItem -l "Hotbox Style" -subMenu true`;
  268.         menu -e -pmc ( "buildHotboxStyleMenu " + $menu ) $menu;
  269.     setParent -m ..;
  270.  
  271.     menuItem -divider true;
  272.  
  273.     string $menu = `menuItem -l "Window Options" -subMenu true`;
  274.         menu -e -pmc ( "buildWinOptions " + $menu ) $menu;
  275.     setParent -m ..;
  276. //}
  277.  
  278.